<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>这是一个thyne leaf的教学实例</title>
</head>
<body>
<div>
    <h3>1.显示JAVA数据</h3>
    <div>
        显示username中的数据使用span<br >
        <span th:text="${user.username}">
        </span>
在文本输入框中显示数据：<br>
        <input type="text " value="用户名称" name="username" th:value="${user.role}">

</div>
<div>
    <h3> 2. if语句的使用</h3>
        <a th:href="main.html"th:if="${user.username !=null}">login1</a>
        <a th:href="main.html"th:unless="${user.username !=null}">login2</a>

</div>

<div th:switch="${user.role}">
    <p th:case="'admin'">User is an administrator</p>
    <p th:case="'manager'">User is a manage</p>
    <p th:case="*">User is some other thing</p>


</div>
</body>
</html>
